import { createRouter, createWebHashHistory } from "vue-router";

import HomePage from "@/pages/home/index.vue";

const routes = [
  {
    path: "/login",
    name: "login",
    component: () => import("@/pages/login/index.vue"),
  },
  {
    path: "/",
    name: "home",
    component: HomePage,
    children: [
      {
        path: "/order",
        name: "order",
        component: () => import("@/pages/order/index.vue"),
      },
      {
        path: "/dashboard",
        name: "dashboard",
        component: () => import("@/pages/home/dashboard.vue"),
      },
      {
        path: "/good",
        name: "good",
        component: () => import("@/pages/good/index.vue"),
      },
      {
        path: "/homeSetting",
        name: "homeSetting",
        component: () => import("@/pages/home/setting.vue"),
      },
      {
        path: "/category",
        name: "category",
        component: () => import("@/pages/category/index.vue"),
      },
      {
        path: "/shopper",
        name: "shopper",
        component: () => import("@/pages/shipping/shopper.vue"),
      },
      {
        path: "/delivery",
        name: "delivery",
        component: () => import("@/pages/shipping/deliveryMap.vue"),
      },
      {
        path: "/coupon",
        name: "coupon",
        component: () => import("@/pages/coupon/index.vue"),
      },
      {
        path: "/homeSetting",
        name: "homeSetting",
        component: () => import("@/pages/home/setting.vue"),
      },
      {
        path: "/makeProduct",
        name: "makeProduct",
        component: () => import("@/pages/order/MakeProduct.vue"),
      },
      {
        path: "/org",
        name: "org",
        component: () => import("@/pages/system/org/index.vue"),
      },
      {
        path: "/role",
        name: "role",
        component: () => import("@/pages/system/role/index.vue"),
      },
      {
        path: "/user",
        name: "user",
        component: () => import("@/pages/system/user/index.vue"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
